import httpx  
import json as JSON
  
class AsyncHttpClient:  
    async def run(self, method, url,headers='', params='', json=''):  
        """  
        发起HTTP请求的基础方法  
        :param method: 请求方法（'GET', 'POST', 'PUT', 'DELETE'）  
        :param url: 请求的URL（如果提供了base_url，则这是相对路径）  
        :param params: URL参数 
        :param json: 请求体，JSON格式，字典将被自动转换为JSON字符串  
        :return: 响应的text和json（如果响应内容可以转换为JSON）  
        """  
        if headers=='':headers=None
        elif isinstance(headers,str):headers=JSON.loads(headers)
        if json=='':json=None
        elif isinstance(json,str):json=JSON.loads(json)
        full_url = url +('?'+params if params else '')
        async with httpx.AsyncClient() as client:  
            response = await client.request(  
                method=method,  
                url=full_url,  
                json=json  ,
                headers=headers
            )  
            res={}
            try:
                res['json']=response.json()
            except:pass
            res['text']=response.text
            return res
import time
# 使用示例  
async def main():  
    client = AsyncHttpClient()  
    print("\n"*3)
    # GET 请求示例  
    res = await client.run("post","http://app.wlwapp.cn/api/v2/login", json={'username': '18032381282', 'password': '5690dddfa28ae085d23518a035707282'})  
    token=res['json']['data']['token']
    print("1.登录认证 获取到token",token,'\n')
    # POST 请求示例  
    res= await client.run("post","http://app.wlwapp.cn/api/v2/device",headers={"token":token},json={ } )
    print("2.获取设备列表:", res,'\n')  
    
    lst=[item['did'] for item in res['json']['data']]
    for did in lst:
        res= await client.run("post","http://app.wlwapp.cn/api/v2/data",headers={"token":token},json={"did":did} )
        print("3.获取设备实时数据:", res,'\n')  
        res= await client.run("post","http://app.wlwapp.cn/api/v2/picnow",headers={"token":token},json={"did":did} )
        print("4.获取最新照片:", res,'\n')  
        res= await client.run("post","http://app.wlwapp.cn/api/v2/picRecord",params="num=10&pages=1",headers={"token":token},json={"did":did,
"startTime": "2022-11-28 09:54:12",
"endTime": "2025-05-31 09:54:12"} )
        print("5.获取历史数据:", res,'\n')  
        res= await client.run("post","http://app.wlwapp.cn/api/v2/opnow",headers={"token":token},json={"did":did} )
        print("6.获取最新设备控制状态:", res,'\n')  
        res= await client.run("post","http://app.wlwapp.cn/api/v2/ctrl",headers={"token":token},json={"did":did} )
        print("7.获取设备控制参数:", res,'\n')  
        for item in res['json']['data']:
            groupname=item['groupname']
            for ii in range(len(item['list'])-1,-1,-1):
                item2=item["list"][ii]
                cmd=item2['cmd']
                opname=item2['opname']
                json_data={"did": did, 
                        "cmd": cmd, 
                        "groupname": groupname, 
                        "opname": opname}
                print("json_data",json_data)
                res= await client.run("post","http://app.wlwapp.cn/api/v2/op",headers={"token":token},json=json_data
                        )
                print("8.发送控制命令:", res,'\n')  
                # input("..")


  
# 运行异步主函数  
import asyncio
asyncio.run(main())



# 1.登录认证 获取到token M0T5c6yfN6z7g40cMcT9Yf26MTQxMCw5MDY0MTAwMjIxNzk0YTFiOWIxZTUzMGJhMDVhNThlMiw5MDY0MTAwMjIxNzk0YTFiOWIxZTUzMGJhMDVhNThlMiwxNzI3ODQxNjYxNDEw

# 2.获取设备列表: {'json': {'msg': '操作成功', 'data': [{'del_flag': '0', 'video_json': '', 'type': '虫情测报', 'update_date': '2024-09-07 11:55:33', 'create_by': '1', 'datetime': '2024-08-26', 'mysort': 0, 'sim': '无', 'name': '智慧虫情测报站', 'id': '6b1958bb81bf45bc979fe2700eeaf42d', 'create_date': '2024-09-07 11:55:32', 'update_by': 'd708920d37ac4c7cb3ccc0132f0a98e8', 'did': 'AAAA402A8FB24514', 'status': '已连接'}], 'status': 1}, 'text': '{"msg":"操作成功","data":[{"del_flag":"0","video_json":"","type":"虫情测报","update_date":"2024-09-07 11:55:33","create_by":"1","datetime":"2024-08-26","mysort":0,"sim":"无","name":"智慧虫情测报站","id":"6b1958bb81bf45bc979fe2700eeaf42d","create_date":"2024-09-07 11:55:32","update_by":"d708920d37ac4c7cb3ccc0132f0a98e8","did":"AAAA402A8FB24514","status":"已连接"}],"status":1}'}

# 3.获取设备实时数据: {'json': {'msg': '操作成功', 'data': [{'datetime': '2024-09-25 12:01:16', 'jsonstr': '[{"unit":"℃","ename":"ins-Temp1","name":"杀虫仓温度","value":"21"},{"unit":"℃","ename":"ins-Temp2","name":"烘干仓温度","value":"22"},{"unit":"","ename":"ins-State","name":"降雨
# 状态","value":"0"},{"unit":"Lux","ename":"ins-light","name":"光照度","value":"208"}]', 'did': 'AAAA402A8FB24514'}], 'status': 1}, 'text': '{"msg":"操作成功","data":[{"datetime":"2024-09-25 12:01:16","jsonstr":"[{\\"unit\\":\\"℃\\",\\"ename\\":\\"ins-Temp1\\",\\"name\\":\\"杀虫仓温 
# 度\\",\\"value\\":\\"21\\"},{\\"unit\\":\\"℃\\",\\"ename\\":\\"ins-Temp2\\",\\"name\\":\\"烘干仓温度\\",\\"value\\":\\"22\\"},{\\"unit\\":\\"\\",\\"ename\\":\\"ins-State\\",\\"name\\":\\"降雨状态\\",\\"value\\":\\"0\\"},{\\"unit\\":\\"Lux\\",\\"ename\\":\\"ins-light\\",\\"name\\":\\"光照度\\",\\"value\\":\\"208\\"}]","did":"AAAA402A8FB24514"}],"status":1}'}

# 4.获取最新照片: {'json': {'msg': '操作成功', 'data': [{'datetime': '2024-09-25 00:49:22', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 
# 'http://admin.wlwapp.cn/uploads/2024-09/16a771d091c07f8c1dfc7585f4691cc1.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/275b4811bd4ea837.jpg', 'id': 33552.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}], 'status': 1}, 'text': '{"msg":"操作成功","data":[{"datetime":"2024-09-25 00:49:22","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/16a771d091c07f8c1dfc7585f4691cc1.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/275b4811bd4ea837.jpg","id":33552.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0}],"status":1}'}

# 5.获取历史数据: {'json': {'msg': '操作成功', 'data': [{'datetime': '2024-08-27 09:00:51', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 
# 'http://admin.wlwapp.cn/uploads/2024-08/4c61a9df1c11501719407615f95758f5.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-08/e498410a9a242a26.jpg', 'id': 31207.0, 'did': 'AAAA402A8FB24514', 'url': '2024-08', 'ai_status': 1.0}, {'datetime': '2024-08-27 10:21:49', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-08/a027717cbbae1cf3d3667e66866042ea.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-08/e952499b9a3c41d9.jpg', 'id': 31212.0, 'did': 'AAAA402A8FB24514', 'url': '2024-08', 'ai_status': 1.0}, {'datetime': '2024-08-27 11:18:22', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-08/ad752cd674afc598b1ad1028c0a30553.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-08/c4e14ab99b2fec59.jpg', 'id': 31222.0, 'did': 'AAAA402A8FB24514', 'url': '2024-08', 'ai_status': 1.0}, {'datetime': '2024-08-27 12:30:15', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-08/094221b995795f7e7d806ab7f4579fc0.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-08/f56c43549f0b647b.jpg', 'id': 31227.0, 'did': 'AAAA402A8FB24514', 'url': '2024-08', 'ai_status': 1.0}, {'datetime': '2024-09-07 21:09:49', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/ecdd32658d2696144cabe4290bd9f00f.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/d4c64518a4edae2f.jpg', 'id': 31983.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}, {'datetime': '2024-09-07 21:10:28', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/2e22e20c275c504ded6e6106f4399614.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/42d6458aac505de4.jpg', 'id': 31986.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}, {'datetime': '2024-09-07 22:22:55', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/d0a4fd1b08d6d25f8beb746221f50f3f.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/302746848b0002fa.jpg', 'id': 32004.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}, {'datetime': '2024-09-07 22:23:39', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/f956074c0856764cafea429fb51b8a87.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/dc4c4f75b731b626.jpg', 'id': 32007.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}, {'datetime': '2024-09-07 23:35:50', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/c1dade5bbc800837c7ca1ec169a4af16.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/106945aeb69e2c9f.jpg', 'id': 32018.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}, {'datetime': '2024-09-07 23:36:26', 'ai_result': '[]', 'ai_result_num': '[]', 'thumb': 'http://admin.wlwapp.cn/uploads/2024-09/a71876fa6257e2b2651824f3df5fb02b.jpg', 'ai_engine': '飞浆V21', 'source_thumb': 'http://admin.wlwapp.cn/uploads/2024-09/bd3749769c781b9b.jpg', 'id': 32021.0, 'did': 'AAAA402A8FB24514', 'url': '2024-09', 'ai_status': 1.0}], 'count': 101.0, 'status': 1}, 'text': '{"msg":"操作成功","data":[{"datetime":"2024-08-27 09:00:51","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-08/4c61a9df1c11501719407615f95758f5.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-08/e498410a9a242a26.jpg","id":31207.0,"did":"AAAA402A8FB24514","url":"2024-08","ai_status":1.0},{"datetime":"2024-08-27 10:21:49","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-08/a027717cbbae1cf3d3667e66866042ea.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-08/e952499b9a3c41d9.jpg","id":31212.0,"did":"AAAA402A8FB24514","url":"2024-08","ai_status":1.0},{"datetime":"2024-08-27 11:18:22","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-08/ad752cd674afc598b1ad1028c0a30553.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-08/c4e14ab99b2fec59.jpg","id":31222.0,"did":"AAAA402A8FB24514","url":"2024-08","ai_status":1.0},{"datetime":"2024-08-27 12:30:15","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-08/094221b995795f7e7d806ab7f4579fc0.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-08/f56c43549f0b647b.jpg","id":31227.0,"did":"AAAA402A8FB24514","url":"2024-08","ai_status":1.0},{"datetime":"2024-09-07 21:09:49","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/ecdd32658d2696144cabe4290bd9f00f.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/d4c64518a4edae2f.jpg","id":31983.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0},{"datetime":"2024-09-07 21:10:28","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/2e22e20c275c504ded6e6106f4399614.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/42d6458aac505de4.jpg","id":31986.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0},{"datetime":"2024-09-07 22:22:55","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/d0a4fd1b08d6d25f8beb746221f50f3f.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/302746848b0002fa.jpg","id":32004.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0},{"datetime":"2024-09-07 22:23:39","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/f956074c0856764cafea429fb51b8a87.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/dc4c4f75b731b626.jpg","id":32007.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0},{"datetime":"2024-09-07 23:35:50","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/c1dade5bbc800837c7ca1ec169a4af16.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/106945aeb69e2c9f.jpg","id":32018.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0},{"datetime":"2024-09-07 23:36:26","ai_result":"[]","ai_result_num":"[]","thumb":"http://admin.wlwapp.cn/uploads/2024-09/a71876fa6257e2b2651824f3df5fb02b.jpg","ai_engine":"飞浆V21","source_thumb":"http://admin.wlwapp.cn/uploads/2024-09/bd3749769c781b9b.jpg","id":32021.0,"did":"AAAA402A8FB24514","url":"2024-09","ai_status":1.0}],"count":101.0,"status":1}'} 

# 6.获取最新设备控制状态: {'json': {'msg': '操作成功', 'data': {'datetime': '2024-09-25 12:01:19', 'did': 'AAAA402A8FB24514', 'op': [{'groupname': '运行模式', 'status': '手动'}, {'groupname': '诱虫灯', 'status': '关闭'}, {'groupname': '吹虫风机', 'status': '关闭'}, {'groupname': '雨 
# 虫挡板', 'status': '关闭'}, {'groupname': '杀虫仓上挡板', 'status': '关闭'}, {'groupname': '杀虫仓加热', 'status': '关闭'}, {'groupname': '杀
# 虫仓下挡板', 'status': '关闭'}, {'groupname': '烘干仓加热', 'status': '关闭'}, {'groupname': '烘干仓下挡板', 'status': '关闭'}, {'groupname': '震动装置', 'status': '关闭'}, {'groupname': '补光灯', 'status': '关闭'}, {'groupname': '摄像头', 'status': '开启'}, {'groupname': '清扫装置
# ', 'status': '关闭'}]}, 'status': 1}, 'text': '{"msg":"操作成功","data":{"datetime":"2024-09-25 12:01:19","did":"AAAA402A8FB24514","op":[{"groupname":"运行模式","status":"手动"},{"groupname":"诱虫灯","status":"关闭"},{"groupname":"吹虫风机","status":"关闭"},{"groupname":"雨虫挡板","status":"关闭"},{"groupname":"杀虫仓上挡板","status":"关闭"},{"groupname":"杀虫仓加热","status":"关闭"},{"groupname":"杀虫仓下挡板","status":"关闭"},{"groupname":"烘干仓加热","status":"关闭"},{"groupname":"烘干仓下挡板","status":"关闭"},{"groupname":"震动装置","status":"关闭"},{"groupname":"补光灯","status":"关闭"},{"groupname":"摄像头","status":"开启"},{"groupname":"清扫装置","status":"关闭"}]},"status":1}'}

# 7.获取设备控制参数: {'json': {'msg': '操作成功', 'data': [{'list': [{'opname': '手动', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMDAwRkE='}, {'opname': '自动', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMTAwRkE='}], 'groupname': '运行模式'}, {'list': [{'opname': 
# '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMjAwMDY='}], 'groupname': '诱虫灯'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMjAwMDY='}], 'groupname': '吹虫风机'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMjAwMDY='}], 'groupname': '雨虫挡板'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMTAwMDY='}, {'opname': '关闭', 'cmd': 
# 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMjAwMDY='}], 'groupname': '杀虫仓上挡板'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMjAwMDY='}], 'groupname': '杀 
# 虫仓加热'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMjAwMDY='}], 'groupname': '杀虫仓下挡板'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDcwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDcwMjAwMDY='}], 'groupname': '烘干仓加热'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDgwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDgwMjAwMDY='}], 'groupname': '烘干仓下挡板'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDkwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDkwMjAwMDY='}], 'groupname': '震动装置'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDEwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDEwMjAwMDY='}], 'groupname': '补光灯'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDIwMTAwMDY='}], 'groupname': '摄像头'}, {'list': [{'opname': '开启', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDMwMTAwMDY='}, {'opname': '关闭', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDMwMjAwMDY='}], 'groupname': '清扫装置'}], 'status': 1}, 'text': '{"msg":"操作成功","data":[{"list":[{"opname":"手动","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMDAwRkE\\u003d"},{"opname":"自动","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMTAwRkE\\u003d"}],"groupname":"运行模式"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMjAwMDY\\u003d"}],"groupname":"诱虫灯"},{"list":[{"opname":" 
# 开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMjAwMDY\\u003d"}],"groupname":"吹虫风机"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMjAwMDY\\u003d"}],"groupname":"雨虫挡板"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMjAwMDY\\u003d"}],"groupname":"杀虫仓上挡板"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMTAwMDY\\u003d"},{"opname":"关闭
# ","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMjAwMDY\\u003d"}],"groupname":"杀虫仓加热"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMjAwMDY\\u003d"}],"groupname":"杀虫仓下挡板"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDcwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDcwMjAwMDY\\u003d"}],"groupname":"烘干仓加热"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDgwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDgwMjAwMDY\\u003d"}],"groupname":" 
# 烘干仓下挡板"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDkwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDkwMjAwMDY\\u003d"}],"groupname":"震动装置"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDEwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDEwMjAwMDY\\u003d"}],"groupname":"补光灯"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDIwMTAwMDY\\u003d"}],"groupname":"摄像头"},{"list":[{"opname":"开启","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDMwMTAwMDY\\u003d"},{"opname":"关闭","cmd":"M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwODAwMDMwMjAwMDY\\u003d"}],"groupname":"清扫装置"}],"status":1}'}

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMTAwRkE=', 'groupname': '运行模式', 'opname': '自动
# '}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsRkFGQkZBMDAwMDAwRkE=', 'groupname': '运行模式', 'opname': '手动
# '}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMjAwMDY=', 'groupname': '诱虫灯', 'opname': '关闭'}8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMTIwMTAwMDY=', 'groupname': '诱虫灯', 'opname': '开启'}8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMjAwMDY=', 'groupname': '吹虫风机', 'opname': '关闭
# '}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDIwMTAwMDY=', 'groupname': '吹虫风机', 'opname': '开启
# '}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMjAwMDY=', 'groupname': '雨虫挡板', 'opname': '关闭
# '}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDMwMTAwMDY=', 'groupname': '雨虫挡板', 'opname': '开启
# '}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMjAwMDY=', 'groupname': '杀虫仓上挡板', 'opname': '关闭'}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDQwMTAwMDY=', 'groupname': '杀虫仓上挡板', 'opname': '开启'}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMjAwMDY=', 'groupname': '杀虫仓加热', 'opname': '关
# 闭'}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDUwMTAwMDY=', 'groupname': '杀虫仓加热', 'opname': '开
# 启'}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMjAwMDY=', 'groupname': '杀虫仓下挡板', 'opname': '关闭'}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDYwMTAwMDY=', 'groupname': '杀虫仓下挡板', 'opname': '开启'}
# 8.发送控制命令: {'json': {'msg': '操作成功', 'status': 1}, 'text': '{"msg":"操作成功","status":1}'} 

# json_data {'did': 'AAAA402A8FB24514', 'cmd': 'M0j5A6yfN6D7A45cMcj9Ufx6MjAxMDUsMDEwNzAwMDcwMjAwMDY=', 'groupname': '烘干仓加热', 'opname': '关
# 闭'}
# 8.发送控制命令: {'json': {'msg': '操作失败', 'status': -1}, 'text': '{"msg":"操作失败","status":-1}'} 
